package com.sumainfor.common.util;

import com.alibaba.fastjson.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * 唐巢&蜂电开放平台
 * @ClassName: InteDeviceBeeUtil
 * @author xzzhao
 * @date 2019年3月11日
 */
public class InteDeviceBeeUtil {
    static Logger  log = LoggerFactory.getLogger(InteDeviceBeeUtil.class);// 日志
    /**
     * 用户登陆
     * @param userid
     * @param pass
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> userLogin(String userid, String pass,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/user/login/"+userid+"/"+pass;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doGet(url,hearderParm);
        log.info(params.toString());
        return params;
    }

    /**
     * 刷新令牌
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> userTokenRefresh(Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/user/token/refresh";
        //发送请求
        Map<String,Object> params=HttpUtilBee.doGet(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 绑定集中器
     * @param cid
     * @param macid
     * @param userid
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> terminalBind(String cid,String macid,String userid,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/terminal/bind/"+cid+"/"+macid+"/"+userid;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doPut(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 集中器锁定/解锁
     * @param cid
     * @param value
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> terminalLock(String cid,String value,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/terminal/lock/"+cid+"/"+value;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doPut(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 重启集中器
     * @param cid
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> terminalReload(String cid,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/terminal/reload/"+cid;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doPut(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     *解绑集中器
     * @param cid
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> terminalUnbound(String cid,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/terminal/unbound/"+cid;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doPut(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }
    /**
     *绑定节点
     * @param nid
     * @param cid
     * @param custcode
     * @param pid
     * @param vid
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> nodeBind(String nid,String cid,String custcode
            ,String pid,String vid,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/node/bind/"+nid+"/"+cid
                +"/"+custcode+"/"+pid+"/"+vid;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doPut(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }
    /**
     *解绑节点
     * @param nid
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> nodeUnbound(String nid,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/node/unbound/"+nid;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doPut(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 获取单个电表
     * @param devid
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> deviceAmmeter(String devid,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/device/ammeter/"+devid;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doGet(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }
    /**
     * 刷新单个电表
     * @param devid
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> deviceAmmeters(String devid,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/device/ammeter/"+devid;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doGet(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 抄表指令
     * @param devid
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> deviceAmmeterz(String devid,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/device/ammeter/"+devid;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doPut(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 修改付费模式
     * @param devid
     * @param value
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> deviceAmmeterPaymode(String devid,String value,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/device/ammeter/paymode/"+devid+"/"+value;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doPut(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 电表入住
     * @param devid
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> deviceAmmeterStayroom(String devid, Map<String,Object> hearderParm, JSONObject bodyJson) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/device/ammeter/stayroom/"+devid;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doPut(url,hearderParm,bodyJson);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 电表退房清单
     * @param devid
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> deviceAmmeterRecederoom(String devid,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/device/ammeter/recederoom/"+devid;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doPut(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 电表类型
     * @param devid
     * @param value
     * @param hearderParm
     * @param bodyJson
     * @return
     */
    public static Map<String,Object> deviceAmmeterChangetype(String devid,String value
            ,Map<String,Object> hearderParm, String bodyJson) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/device/ammeter/changetype/"+devid+"/"+value;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doPut(url,hearderParm,bodyJson);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 设备断电
     * @param devid
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> deviceSwitchoff(String devid,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/device/switchoff/"+devid;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doPut(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 设备通电
     * @param devid
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> deviceSwitchon(String devid,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/device/switchon/"+devid;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doPut(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 电表确认退房
     * @param devid
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> deviceAmmeterConfirmrecederoom(String devid,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/device/ammeter/confirmrecederoom/"+devid;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doPut(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 上报时间
     * @param devid
     * @param value
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> deviceAmmeterCollection(String devid,String value,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/device/ammeter/collection/"+devid+"/"+value;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doPut(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 电表报表
     * @param devid
     * @param bdate
     * @param edate
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> deviceAmmeterReport(String devid,String bdate,String edate,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/device/ammeter/report/"+devid+"/"+bdate+"/"+edate;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doGet(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 设备充值记录
     * @param devid
     * @param bdate
     * @param edate
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> accountRecharge(String devid,String bdate,String edate,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/account/recharge/"+devid+"/"+bdate+"/"+edate;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doGet(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 用户充值记录
     * @param bdate
     * @param edate
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> accountRecharge(String bdate,String edate,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/account/recharge/"+bdate+"/"+edate;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doGet(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 账户余额
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> accountOverage(Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/account/overage";
        //发送请求
        Map<String,Object> params=HttpUtilBee.doGet(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 提现记录
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> account(Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/account";
        //发送请求
        Map<String,Object> params=HttpUtilBee.doGet(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 电表充值 电量
     * @param devid
     * @param value
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> accountThreshold(String devid,String value,Map<String,Object> hearderParm) {
        //充值电量(单位百分之1度，如1表示0.01度)
        int eleNum=Integer.parseInt(value)*100;
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/account/threshold/"+devid+"/"+eleNum;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doPut(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 电表充值 金额
     * @param devid
     * @param value
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> accountRechargej(String devid,String value,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/account/recharge/"+devid+"/"+value;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doPut(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }





    /**
     * 电表充值 金额
     * @param devid
     * @param value
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> accountRechargejS(String devid,float value,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/account/recharge/"+devid+"/"+value;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doPut(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 判断集中器or节点
     * @param pid
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> deviceChecktype(String pid,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/device/checktype/"+pid;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doGet(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }
    /**
     * 城市选择  省
     * @param subtype
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> houseCity(String subtype,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/house/city/"+subtype;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doGet(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }
    /**
     * 城市选择 市 区 小区
     * @param subtype
     * @param pcode
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> houseCity(String subtype,String pcode,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/house/city/"+subtype+"/"+pcode;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doGet(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     *创建小区
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> houseDistrict(Map<String,Object> hearderParm,JSONObject bodyJson) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/house/district";
        //发送请求
        Map<String,Object> params=HttpUtilBee.doPost(url,hearderParm,bodyJson);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 搜索小区
     * @param search
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> houseDistrict(String search,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/house/district/"+search;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doGet(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }
    /**
     * 选择分组
     * @param districtcode
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> houseSelect(String districtcode,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/house/select/"+districtcode;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doGet(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }
    /**
     * 选择分组
     * @param districtcode
     * @param pcode
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> houseSelect(String districtcode,String pcode,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/house/select/"+districtcode+"/"+pcode;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doGet(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 创建房源分组
     * @param hearderParm
     * @param bodyJson
     * @return
     */
    public static Map<String,Object> house(Map<String,Object> hearderParm,JSONObject bodyJson) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/house";
        //发送请求
        Map<String,Object> params=HttpUtilBee.doPost(url,hearderParm,bodyJson);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 修改房源分组
     * @param hearderParm
     * @param bodyJson
     * @return
     */
    public static Map<String,Object> houseUpdate(Map<String,Object> hearderParm,JSONObject bodyJson) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/house";
        //发送请求
        Map<String,Object> params=HttpUtilBee.doPost(url,hearderParm,bodyJson);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 删除房源分组
     * @param hid
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> houseDelete(String hid,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/house/"+hid;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doDelete(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 添加房源设备
     * @param devid
     * @param hid
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> houseDevice(String devid,String hid,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/house/device/"+devid+"/"+hid;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doPut(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }
    /**
     * 获取房源设备 有hid是查询该房源分组编号下的设备
     * @param hid
     * @return
     */
    public static Map<String,Object> houseDevice(String hid,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/house/device/"+hid;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doGet(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }
    /**
     * 获取房源设备 没有hid是查询为分组的前50个设备
     * @return
     */
    public static Map<String,Object> houseDevice(Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/house/device";
        //发送请求
        Map<String,Object> params=HttpUtilBee.doGet(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 删除房源设备
     * @param devid
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> houseDeviceDelete(String devid,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/house/device/"+devid;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doDelete(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 获取房源树
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> getHouse(Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/house";
        //发送请求
        Map<String,Object> params=HttpUtilBee.doGet(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 获取房源树
     * @param district
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> getHouse(String district,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/house/refresh/"+district;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doGet(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 获取房源树
     * @param district
     * @param code
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> getHouse(String district,String code,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/house/refresh/"+district+"/"+code;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doGet(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 修改电价
     * @param devid
     * @param value
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> deviceAmmeterPrice(String devid,String value,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/device/ammeter/price/"+devid+"/"+value;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doPut(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 将设备权限授权给其他用户
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> permission(Map<String,Object> hearderParm,JSONObject bodyJson) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/permission";
        //发送请求
        Map<String,Object> params=HttpUtilBee.doPost(url,hearderParm,bodyJson);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 获取设备授权
     * @param devid
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> permissionDevice(String devid,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/permission/device/"+devid;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doGet(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 获取用户授权
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> permissionUser(Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/permission/user";
        //发送请求
        Map<String,Object> params=HttpUtilBee.doGet(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 获取用户授权
     * @param userid
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> permissionUser(String userid,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/permission/user/"+userid;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doGet(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 修改用户的授权
     * @param pid
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> permissionUserUpdate(String pid,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/permission/"+pid;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doPut(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 搜索房源
     * @param type
     * @param search
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> houseSearch(String type,String search,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/house/search/"+type+"/"+search;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doGet(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     *报表 离线设备 小时记
     * @param hour
     * @param index
     * @param size
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> reportOfflinehour(String hour,String index,String size,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/report/offlinehour/"+hour+"/"+index+"/"+size;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doGet(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 报表离线设备统计
     * @param hour
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> reportOfflinehourCount(String hour,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/report/offlinehour/count/"+hour;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doGet(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 报表长时间无数据报 小时记
     * @param hour
     * @param index
     * @param size
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> reportOnlinenodatahour(String hour,String index
            ,String size,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/report/onlinenodatahour/"
                +hour+"/"+index+"/"+size;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doGet(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 报表长时间无数据上报数量统计
     * @param hour
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> reportOnlinenodatahourCount(String hour,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/report/onlinenodatahour/count/"+hour;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doGet(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 通过设备id获取设备一段时间的用电统计
     * @param bdate
     * @param edate
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> reportAddupdevice(String bdate
            ,String edate,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/report/addupdevice/"+bdate
                +"/"+edate;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doPost(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 获取设备的操作日志
     * @param devid
     * @param index
     * @param size
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> loggerPaging(String devid,String index,String size
            ,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/logger/paging/"+devid +"/"+index+"/"+size;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doGet(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 通过设备编号批量获取电表
     * @param pcode
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> deviceAmmeterPcode(List<String> pcode,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url= null;
        List<String> aList=new ArrayList<String>();
        String prodeString="";
        for (int i=0;i<pcode.size();i++){
            pcode.set(i,"\""+pcode.get(i)+"\"");
        }
        prodeString= String.join(",", pcode);
        try {
            url = "http://smartammeter.zg118.com:8001/device/ammeter/pcode/"+ URLEncoder.encode("["+prodeString+"]", "UTF-8");

        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        //发送请求
        Map<String,Object> params=HttpUtilBee.doGet(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

//    /**
//     * 蜂电设备清零
//     * @param pcode
//     * @param hearderParm
//     * @return
//     */
//    public static Map<String,Object> MeterReset(List<String> pcode,Map<String,Object> hearderParm){
//
//    }








    /**
     * 市场统计报表
     * @param userid
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> reportComputestaytime(String userid,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/report/computestaytime/"+userid;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doGet(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 获取当前账户下的入住情况
     * @param bdate
     * @param edate
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> reportOccupancyrate(String bdate,String edate
            ,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/report/occupancyrate/"+bdate+
                "/"+edate;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doGet(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 获取当前用户下制定区域的入住情况
     * @param bdate
     * @param edate
     * @param districtcode
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> reportOccupancyrate(String bdate,String edate,String districtcode
            ,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/report/occupancyrate/"+bdate+
                "/"+edate+"/"+districtcode;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doGet(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 获取当前用户下的指定房源的入住情况
     * @param bdate
     * @param edate
     * @param districtcode
     * @param code
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> reportOccupancyrate(String bdate,String edate,String districtcode
            ,String code,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/report/occupancyrate/"+bdate+
                "/"+edate+"/"+districtcode+"/"+code;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doGet(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 用电量小计
     * @param devid
     * @param bdate
     * @param edate
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> ammeterAddup(String devid,String bdate,String edate
            ,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/device/ammeter/addup/month/"+devid+
                "/"+bdate+"/"+edate;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doGet(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 分页获取电表
     * @param pageno
     * @param pagesize
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> ammeterPage(String pageno,String pagesize
            ,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/device/ammeter/page/"+pageno+
                "/"+pagesize;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doGet(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 获取电表数量
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> ammeterPageCount(Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/device/ammeter/page/count";
        //发送请求
        Map<String,Object> params=HttpUtilBee.doGet(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 获取设备入住记录
     * @param bdate
     * @param edate
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> ammeterRoom(String bdate,String edate,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/device/ammeter/room/"+bdate+"/"+edate;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doGet(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    /**
     * 获取设备用电电量
     * @param devid
     * @param hearderParm
     * @return
     */
    public static Map<String,Object> ammeterAddup(String devid,Map<String,Object> hearderParm) {
        // 装配请求参数
        String url="http://smartammeter.zg118.com:8001/account/addup/"+devid;
        //发送请求
        Map<String,Object> params=HttpUtilBee.doGet(url,hearderParm);
        System.out.println("返回的参数:"+params);
        return params;
    }

    public static void main(String[] args) {
        /*用户登录*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("version","0116010101");
//        params.put("appid",InteDeviceBeeConfig.APP_ID);
//        InteDeviceBeeUtil.userLogin(InteDeviceBeeConfig.USERID, InteDeviceBeeConfig.PASS,params);
        /*刷新令牌*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","8157849e0b7d71a2c4d6b6bfd37e4640");
//        params.put("version","0116010101");
//        InteDeviceBeeUtil.userTokenRefresh(params);
        /*获取房源设备*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","33024afa71fe1727849c2d376a9922f6");
//        params.put("version","0116010101");
//        InteDeviceBeeUtil.houseDevice(params);
        /* 绑定集中器*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","32a0c92303e01cc74098a062e15a446a");
//        InteDeviceBeeUtil.terminalBind("21","11","11",params);
        /*集中器锁定/解锁*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","49b20252089d3855ab5945b030d65407");
//        InteDeviceBeeUtil.terminalLock("21","11",params);
        /*重启集中器*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","49b20252089d3855ab5945b030d65407");
//        InteDeviceBeeUtil.terminalReload("21",params);
        /*解绑集中器*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","49b20252089d3855ab5945b030d65407");
//        InteDeviceBeeUtil.terminalUnbound("21",params);
        /*绑定节点*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","49b20252089d3855ab5945b030d65407");
//        InteDeviceBeeUtil.nodeBind("21","21","21","21","21",params);
        /*解绑节点*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","49b20252089d3855ab5945b030d65407");
//        InteDeviceBeeUtil.nodeUnbound("21",params);
        /*获取单个电表*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","49b20252089d3855ab5945b030d65407");
//        InteDeviceBeeUtil.deviceAmmeter("21",params);
        /*刷新单个电表*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","49b20252089d3855ab5945b030d65407");
//        InteDeviceBeeUtil.deviceAmmeters("21",params);
        /*抄表指令*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","49b20252089d3855ab5945b030d65407");
//        InteDeviceBeeUtil.deviceAmmeterz("21",params);
        /*修改付费模式*/
//          Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","49b20252089d3855ab5945b030d65407");
//        InteDeviceBeeUtil.deviceAmmeterPaymode("21","0",params);
        /*电表入住(电表入住传参在body的时候有乱码)*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","49b20252089d3855ab5945b030d65407");
//        JSONObject bodyJson=new JSONObject();
//        bodyJson.put("name","张三");
//        bodyJson.put("phone","15722021张三");
//        bodyJson.put("checkingdate","15722021");
//        bodyJson.put("checkoutdate","15722021");
//        bodyJson.put("staymode",0);
//        InteDeviceBeeUtil.deviceAmmeterStayroom("21",params,bodyJson);
        /*电表退房清单*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","49b20252089d3855ab5945b030d65407");
//        InteDeviceBeeUtil.deviceAmmeterRecederoom("21",params);
        /*电表类型*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","49b20252089d3855ab5945b030d65407");
//        JSONObject bodyJson=new JSONObject();
//        List<Map<String,Object>> list=new ArrayList<Map<String,Object>>();
//        Map<String,Object> map=new HashMap<String,Object>();
//        map.put("devid",11);
//        map.put("percent",50);
//        map.put("allpower",1.35);
//        list.add(map);
//        String stringJson=JSON.toJSONString(list);
//        InteDeviceBeeUtil.deviceAmmeterChangetype("21","2",params,stringJson);
        /*设备断电*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","24c91202c95fda74d2355d0352344ab6");
//        InteDeviceBeeUtil.deviceSwitchoff("21",params);
        /*设备通电*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","24c91202c95fda74d2355d0352344ab6");
//        InteDeviceBeeUtil.deviceSwitchon("21",params);
        /*电表确认退房*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","24c91202c95fda74d2355d0352344ab6");
//        InteDeviceBeeUtil.deviceAmmeterConfirmrecederoom("21",params);
        /*上报时间*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","24c91202c95fda74d2355d0352344ab6");
//        InteDeviceBeeUtil.deviceAmmeterCollection("21","21",params);
        /*电表报表*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","24c91202c95fda74d2355d0352344ab6");
//        InteDeviceBeeUtil.deviceAmmeterReport("21","21","2",params);
        /*设备充值记录*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","24c91202c95fda74d2355d0352344ab6");
//        InteDeviceBeeUtil.accountRecharge("21","21","2",params);
        /*用户充值记录*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","24c91202c95fda74d2355d0352344ab6");
//        InteDeviceBeeUtil.accountRecharge("21","2",params);
        /*账单户余额*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","24c91202c95fda74d2355d0352344ab6");
//        InteDeviceBeeUtil.accountOverage(params);
        /*提现记录*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","24c91202c95fda74d2355d0352344ab6");
//        InteDeviceBeeUtil.account(params);
        /*电表充值*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","24c91202c95fda74d2355d0352344ab6");
//        InteDeviceBeeUtil.accountThreshold("2","2",params);
        /*电表充值 金额*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","24c91202c95fda74d2355d0352344ab6");
//        InteDeviceBeeUtil.accountRechargej("2","2",params);
        /*判断集中器or节点*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","24c91202c95fda74d2355d0352344ab6");
//        InteDeviceBeeUtil.deviceChecktype("2",params);
        /*获取城市 省*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","24c91202c95fda74d2355d0352344ab6");
//        InteDeviceBeeUtil.houseCity("0",params);
        /*获取城市 市 区 小区 */
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","24c91202c95fda74d2355d0352344ab6");
//        InteDeviceBeeUtil.houseCity("0","2",params);
        /*创建小区*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","b3dbbe38f246cabeaf56b3dd8f9cc04b");
//        JSONObject bodyJson=new JSONObject();
//        bodyJson.put("name","张三");
//        bodyJson.put("phone","15722021张三");
//        bodyJson.put("checkingdate","15722021");
//        bodyJson.put("checkoutdate","15722021");
//        bodyJson.put("staymode",0);
//        InteDeviceBeeUtil.houseDistrict(params,bodyJson);
        /*
         * 搜索小区*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","b3dbbe38f246cabeaf56b3dd8f9cc04b");
//        InteDeviceBeeUtil.houseDistrict("1",params);
        /*选择分组*/
//                Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","b3dbbe38f246cabeaf56b3dd8f9cc04b");
//        InteDeviceBeeUtil.houseSelect("1","2",params);
        /*创建房源分组*/
//                Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","b3dbbe38f246cabeaf56b3dd8f9cc04b");
//        JSONObject bodyJson=new JSONObject();
//        bodyJson.put("districtcode","1");
//        bodyJson.put("title","1");
//        bodyJson.put("level",0);
//        bodyJson.put("code","15722021");
//        bodyJson.put("structure",0);
//        bodyJson.put("leasetype",0);
//        bodyJson.put("acreage",0);
//        InteDeviceBeeUtil.house(params,bodyJson);
        /*修改房源分组*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","b3dbbe38f246cabeaf56b3dd8f9cc04b");
//        JSONObject bodyJson=new JSONObject();
//        bodyJson.put("districtcode","1");
//        bodyJson.put("title","1");
//        bodyJson.put("level",0);
//        bodyJson.put("code","15722021");
//        bodyJson.put("structure",0);
//        bodyJson.put("leasetype",0);
//        bodyJson.put("acreage",0);
//        InteDeviceBeeUtil.houseUpdate(params,bodyJson);
        /*删除房源设备*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","24c91202c95fda74d2355d0352344ab6");
//        InteDeviceBeeUtil.houseDelete("0",params);
        /*添加房源设备*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","24c91202c95fda74d2355d0352344ab6");
//        InteDeviceBeeUtil.houseDevice("ssss1","sss11",params);
        /*删除房源设备*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","24c91202c95fda74d2355d0352344ab6");
//        InteDeviceBeeUtil.houseDeviceDelete("111",params);
        /*获取房源树*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","24c91202c95fda74d2355d0352344ab6");
//        InteDeviceBeeUtil.getHouse(params);
        /*修改电价*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","24c91202c95fda74d2355d0352344ab6");
//        InteDeviceBeeUtil.deviceAmmeterPrice("1","2",params);
        /*给其他账授权*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","24c91202c95fda74d2355d0352344ab6");
//        Map<String,Object> map=new HashMap<String, Object>();
//        map.put("as",11);
//        JSONObject bodyJson=new JSONObject();
//        bodyJson.put("Devid ","15722021");
//        bodyJson.put("Userid ","15722021");
//        bodyJson.put("Permission ",map);
//
//        InteDeviceBeeUtil.permission(params,bodyJson);
        /*获取设备授权*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","24c91202c95fda74d2355d0352344ab6");
//        InteDeviceBeeUtil.permissionDevice("1",params);
        /*获取用户授权*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","1b5b6f0767cf68d84d8cbb099f0613a1");
//        InteDeviceBeeUtil.permissionUser(params);
        /*修改用户授权*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","1b5b6f0767cf68d84d8cbb099f0613a1");
//        InteDeviceBeeUtil.permissionUserUpdate("1",params);
        /*搜索房源或设备*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","1b5b6f0767cf68d84d8cbb099f0613a1");
//        InteDeviceBeeUtil.houseSearch("1","1",params);
        /*报表 离线设备*/
        Map<String,Object> params=new HashMap<String, Object>();
        params.put("uid","5c876d45cb72df3513c53f6a");
        params.put("token","fb58b3d867e1c498c7a9392e559a1e85");
        InteDeviceBeeUtil.reportOfflinehour("1","1","1",params);
        /*报表离线设备数量统计 小时记*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","1b5b6f0767cf68d84d8cbb099f0613a1");
//        InteDeviceBeeUtil.reportOfflinehourCount("1",params);
        /*报表长时间无数据上报 小时计*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","1b5b6f0767cf68d84d8cbb099f0613a1");
//        InteDeviceBeeUtil.reportOnlinenodatahour("1","1","1",params);
        /*报表长时间无数据上报 数量统计*/
//                Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","1b5b6f0767cf68d84d8cbb099f0613a1");
//        InteDeviceBeeUtil.reportOnlinenodatahourCount("1",params);
        /*通过设备编号 获取设备一段时间的用电统计*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","1b5b6f0767cf68d84d8cbb099f0613a1");
//        InteDeviceBeeUtil.reportAddupdevice("1","1",params);
        /*获取设备的操作日志*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","1b5b6f0767cf68d84d8cbb099f0613a1");
//        InteDeviceBeeUtil.loggerPaging("1","1","1",params);

//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid",InteDeviceBeeConfig.UID);
//        params.put("token","70e9f17304df0bcdffe4a8f193ff967f");
//
//        List<String> aaa=new ArrayList<String>();
//        aaa.add("MN1708257");
//        aaa.add("MN1708260");
//        InteDeviceBeeUtil.deviceAmmeterPcode(aaa,params);
        /*时长统计报表*/
//                Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","1b5b6f0767cf68d84d8cbb099f0613a1");
//        InteDeviceBeeUtil.reportComputestaytime("1",params);
        /*获取当前用户下的入住情况*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","1b5b6f0767cf68d84d8cbb099f0613a1");
//        InteDeviceBeeUtil.reportOccupancyrate("1","1","1","1",params);
        /*用电量小计*/
//                Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","1b5b6f0767cf68d84d8cbb099f0613a1");
//        InteDeviceBeeUtil.ammeterAddup("1","1","1",params);
        /*分页获取电表*/
//                Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","1b5b6f0767cf68d84d8cbb099f0613a1");
//        InteDeviceBeeUtil.ammeterPage("1","1",params);
        /*获取电表数量*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","1b5b6f0767cf68d84d8cbb099f0613a1");
//        InteDeviceBeeUtil.ammeterPageCount(params);
        /*设备入住记录*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","1b5b6f0767cf68d84d8cbb099f0613a1");
//        InteDeviceBeeUtil.ammeterRoom("1","1",params);
        /*获取设备用电电量*/
//        Map<String,Object> params=new HashMap<String, Object>();
//        params.put("uid","5c876d45cb72df3513c53f6a");
//        params.put("token","1b5b6f0767cf68d84d8cbb099f0613a1");
//        InteDeviceBeeUtil.ammeterAddup("1",params);



//        Map<String,Object> pcodeParams=new HashMap<String, Object>();
//        pcodeParams.put("uid",InteDeviceBeeConfig.UID);
//        pcodeParams.put("token","70e9f17304df0bcdffe4a8f193ff967f");
//        String [] aaa={"MN1708556","MN1708257","MN1708227","MN1708260"};
////        //查询各个房间的智能电表的UUID
//        Map<String,Object> pcodeMap=InteDeviceBeeUtil.deviceAmmeterPcode(aaa,pcodeParams);
//        List<Map<String,Object>> pcodeList=(List<Map<String,Object>>)pcodeMap.get("Data");
//        List<String> beeUuidList=new ArrayList<String>();
//        for (Map<String,Object> map: pcodeList){
//            beeUuidList.add(map.get("Uuid").toString());
//        }
//        System.out.println("beeUuidList:"+beeUuidList);
//
//        for (int i=0;i<beeUuidList.size();i++){
//            Map<String,Object> roomMap=new HashMap<String,Object>();
//            roomMap.put("uid",InteDeviceBeeConfig.UID);
//            roomMap.put("token","70e9f17304df0bcdffe4a8f193ff967f");
//            JSONObject bodyJson=new JSONObject();
//            bodyJson.put("name","张三");
//            bodyJson.put("phone","15722021张三");
//            bodyJson.put("checkingdate","15722021");
//            bodyJson.put("checkoutdate","15722021");
//            bodyJson.put("staymode",0);
//            System.out.println(InteDeviceBeeUtil.deviceAmmeterStayroom(beeUuidList.get(i),roomMap,bodyJson));;
//        }

    }
}